package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.HlsDocumentTypeMapper;
import com.bestow.basic.domain.HlsDocumentType;
import com.bestow.basic.service.IHlsDocumentTypeService;

/**
 * 租赁单据类型Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-02
 */
@Service
public class HlsDocumentTypeServiceImpl implements IHlsDocumentTypeService 
{
    @Autowired
    private HlsDocumentTypeMapper hlsDocumentTypeMapper;

    /**
     * 查询租赁单据类型
     * 
     * @param documentType 租赁单据类型主键
     * @return 租赁单据类型
     */
    @Override
    public HlsDocumentType selectHlsDocumentTypeByDocumentType(String documentType)
    {
        return hlsDocumentTypeMapper.selectHlsDocumentTypeByDocumentType(documentType);
    }

    /**
     * 查询租赁单据类型列表
     * 
     * @param hlsDocumentType 租赁单据类型
     * @return 租赁单据类型
     */
    @Override
    public List<HlsDocumentType> selectHlsDocumentTypeList(HlsDocumentType hlsDocumentType)
    {
        return hlsDocumentTypeMapper.selectHlsDocumentTypeList(hlsDocumentType);
    }

    /**
     * 新增租赁单据类型
     * 
     * @param hlsDocumentType 租赁单据类型
     * @return 结果
     */
    @Override
    public int insertHlsDocumentType(HlsDocumentType hlsDocumentType)
    {
        hlsDocumentType.setCreateTime(DateUtils.getNowDate());
        return hlsDocumentTypeMapper.insertHlsDocumentType(hlsDocumentType);
    }

    /**
     * 修改租赁单据类型
     * 
     * @param hlsDocumentType 租赁单据类型
     * @return 结果
     */
    @Override
    public int updateHlsDocumentType(HlsDocumentType hlsDocumentType)
    {
        hlsDocumentType.setUpdateTime(DateUtils.getNowDate());
        return hlsDocumentTypeMapper.updateHlsDocumentType(hlsDocumentType);
    }

    /**
     * 批量删除租赁单据类型
     * 
     * @param documentTypes 需要删除的租赁单据类型主键
     * @return 结果
     */
    @Override
    public int deleteHlsDocumentTypeByDocumentTypes(String[] documentTypes)
    {
        return hlsDocumentTypeMapper.deleteHlsDocumentTypeByDocumentTypes(documentTypes);
    }

    /**
     * 删除租赁单据类型信息
     * 
     * @param documentType 租赁单据类型主键
     * @return 结果
     */
    @Override
    public int deleteHlsDocumentTypeByDocumentType(String documentType)
    {
        return hlsDocumentTypeMapper.deleteHlsDocumentTypeByDocumentType(documentType);
    }
}
